package com.cyufeng.blog.service;

import com.cyufeng.blog.dto.SortDto;
import com.cyufeng.blog.entity.Sort;
import com.cyufeng.blog.repository.SortRepository;
import com.cyufeng.blog.service.mapper.SortMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
/**
 * 文章分类
 * @author Cyufeng
 * Data:2018.12.30
 */
@Service
public class SortService {
    @Autowired
    SortRepository sortRepository;
    SortMapper sortMapper = new SortMapper();


    public List<SortDto> getSort() {
        List<Sort> sortList = new ArrayList<>();
        sortList = sortRepository.getSort();
        List<SortDto> sortDtoList = new ArrayList<>();
        sortDtoList = sortMapper.entityTodto(sortList);
        return sortDtoList;
    }
}
